<?php
/**
 * Created by PhpStorm.
 * User: zhang
 * Date: 2014-12-07
 * Time: 15:47
 */

for($i=0;$i<100000000;$i++){
    if($i % 1000000 == 0){
        $perc = $i/1000000;
        $fh= fopen('test.txt','w');
        fwrite($fh,$perc);
        fclose($fh);
    }
}